// pages/index/home.js
var app = getApp();
var http_service = app.data.service;
Page({
  data: {
    service: http_service,
    data: {},
    id:''
  },
  onLoad: function (options) {
    var that = this;
    that.setData({
      id:options.id
    },function(){
      wx.request({
        url: http_service+'/index.php/getcommoditybyid',
        data:{
          id:options.id
        },
        method:'post',
        dataType:'json',
        success:function(res){
          that.setData({
            data:res.data
          })
        }
      })
    })
  },
  onReady: function () {

  },
  onShow: function () {

  },
  onHide: function () {

  },
  onUnload: function () {

  },
  onPullDownRefresh: function () {

  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {

  },
  onPageScroll: function () {

  },
  onTabItemTap(item) {

  },
  pay(){
    var id= this.data.id;
    wx.request({
      url: '',
    })
  },
})
